<div class="page-container edit-container">
  <div class="loading-body" *ngIf="isPosting">
    <mdl-spinner *ngIf="isPosting" single-color active></mdl-spinner>
  </div>
  <div class="edit-header">
    <a routerLink="/manage" mdl-ripple mdl-button>
			<i class="material-icons">keyboard_backspace</i> 返回
		</a>
    <mdl-layout-title>{{ IsEdit ? '编辑' : '添加' }}管理员</mdl-layout-title>
    <div class="space"></div>
  </div>
  <div class="edit-container mdl-grid">
    <!-- <mdl-layout-title>{{ IsEdit ? '编辑' : '添加' }}人员</mdl-layout-title> -->
    <dynamic-form class="mdl-cell mdl-cell--6-col" #userForm (getPlayLoad)="onLoadFormData($event)" [ctrls]="formControls">

    </dynamic-form>
    <div class="mdl-cell mdl-cell--6-col">
      <p>{{company ? company[0]?.name : ''}}</p>
      <div class="location-wrap">
        <location-select *ngIf="selectedRole === 3" [(Data)]="locationProperties" [static]="true" [show]="true" [(Company)]="company"></location-select>
        <mdl-select *ngIf="selectedRole === 2" class="mdl-cell mdl-cell--3-col" label="选择项目" floating-label [(ngModel)]="selectedProject"
          (change)="projectChange($event)">
          <mdl-option *ngFor="let p of projects" [value]="p.id">{{p.name}}</mdl-option>
        </mdl-select>
      </div>
    </div>
    <!-- <p>
        头像:<photo-uploader 
          [instanceId]="'avatar-btn'" 
          [RemotePath]="'avatar'" 
          [(PhotoSrc)]="avatarPhoto" 
          (UploadedCb)="uploaded($event)"></photo-uploader>
      </p> -->
    <!-- <p>
        识别照片:
        <span>
          <ng-template [ngIf]="uploadPercent > 0 && uploadPercent !== 100">
             <mdl-progress [progress]="uploadPercent"></mdl-progress>
          </ng-template>
          <ng-template [ngIf]="uploadPercent === 100">
          正在写入门禁系统...
           <mdl-progress [indeterminate]="true"></mdl-progress>
          </ng-template>
        </span>
        <photo-uploader [(Percent)]="uploadPercent" (PercentCb)="PercentCallBack($event)" [instanceId]="'photo-btn'" [RemotePath]="'identify'"
         [(PhotoSrc)]="identifyPhoto" (ErrorCb)="onPhotoUploadError($event)" (UploadedCb)="uploaded2($event)"></photo-uploader>
      </p> -->
    <!-- <mdl-spinner *ngIf="isFormPosting" single-color active></mdl-spinner> -->
    <!-- <button mdl-ripple mdl-button mdl-button-type="raised" [disabled]="!userForm.form.valid || isFormPosting" (click)="save(userForm)"
      mdl-colored="primary">
        <i class="material-icons">done</i>保存
      </button> -->
    <!-- <a routerLink="/user" mdl-ripple mdl-button mdl-button-type="raised" mdl-colored="accent">
          <i class="material-icons">keyboard_arrow_left</i> 返回
        </a> -->
  </div>
</div>